﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式之禅.代理者模式
{
    /// <summary>
    /// 抽象主题角色
    /// </summary>
    public abstract class abstractProduct
    {
        public abstract string Say();
    }

    /// <summary>
    /// 真实主题角色
    /// </summary>
    public class Product : abstractProduct
    {
        public override string Say()
        {
            return "A";
        }
    }
    /// <summary>
    /// 代理角色
    /// </summary>
    public class ProductProxy : abstractProduct
    {
        private abstractProduct ab = new Product();
        public override string Say()
        {
            return ab.Say()+" by proxy";
        }
    }
}
